#include "EventHandler.h"
#include "Game.h"

void EventHandler::HandleEvent(const SDL_Event &event)
{
	switch (event.type)
	{
	case SDL_KEYUP:
	case SDL_KEYDOWN:
		OnKeyboardEvent(event.key);
		break;
	case SDL_JOYAXISMOTION:
		OnJoystickAxisEvent(event.jaxis);
		break;
	case SDL_JOYBUTTONDOWN:
		OnJoyButtonEvent(event.jbutton);
		break;
	case SDL_MOUSEMOTION:
		OnMouseEvent(event.motion);
		break;
	case SDL_QUIT:
		Quit();		
		break; 
	}
}

void EventHandler::Quit()
{
	TheGame::Instance()->QuitGame();
}

